<?php
use yii\helpers\Html;
use yii\bootstrap\Alert;
use yii\bootstrap\ActiveForm;
use common\models\company;
$id=Yii::$app->user->id;
$this->params['breadcrumbs'][] = $this->title;
?>
 
  <div class="mcCont mcgCont">

      <div class="right mCertificate mCerfail">
        <h1 class="tt">企业会员认证</h1>

        <div class="certifcateSteps">
          <div class="step achive"><span class="iconNumber">1</span>提交认证</div>
          <div class="step"><span class="iconNumber">2</span>客服审核</div>
          <div class="step"><span class="iconNumber">3</span>认证成功</div>
        </div>
 <?php if($cer){?>
        <div class="topTxt">
          <i class="iconfont icon-info2"></i>
          <div class="txt1">您在<?php echo $cer['create_time']?> 提交的企业认证审核未通过，请您重新提交，<div class="lookwhy">查看原因></div>
          </div>
        </div>
    <form name="company" action="/members/sbtj" method='post' class="membersInfo">
          <p class="item item0"><span class="itemTt0">您的公司信息</span></p>
          <p class="item"><span class="itemTt1">公司名称<i class="iconfont icon-starfull"></i></span>
          <input type="text" name="company_name" class="input1" required/></p>
           <p class="item">
       <!--  <span class="itemTt">省份 <i class="iconfont icon-starfull"></i></span>
        -->
        <select name="province" id="province" class="input2">
            <option value="">请选择</option>
          <?php foreach ($province as $key => $value): ?>
            <option value="<?=$value['id']?>"><?=Html::encode($value['name'])?></option>
          <?php endforeach ?>
        </select>

        <select name="city" id="city"  class="input2">
          <option value="">请选择</option>
        </select>

        <select name="address_detail" id="town" class="input2">
          <option value="">请选择</option>
        </select>
       
      </p>
          <p class="item"><span class="itemTt1">公司详细地址<i class="iconfont icon-starfull"></i></span>
          <input type="text" name="address_detail" class="input3" required></p>
          <p class="item">
            <span class="itemTt1 itemTt2">采购类型/用途<i class="iconfont icon-starfull"></i></span>
            <input  class="check-box" type="checkbox" value="食品添加剂1"/>食品添加剂
            <input  class="check-box" type="checkbox" value="食品添加剂2"/>食品添加剂
            <input  class="check-box" type="checkbox" value="食品添加剂3"/>食品添加剂
            <input  class="check-box" type="checkbox" value="食品添加剂4"/>食品添加剂
            <input name="username" type="hidden">
            <input name="create_time" type="hidden">


      </p>
          <p class="item">
            <span class="itemTt1">企业人数</span>
            <select name="" id="" class="input2">
              <option value="">请选择</option>
            </select>
          </p>
          <p class="item">
            <span class="itemTt1">公司行业</span>
            <select name="" id=""  class="input1">
              <option value="">请选择</option>
            </select>
          </p>
          <p class="item">
            <span class="itemTt1">公司性质</span>
            <select name="" id=""  class="input1">
              <option value="">请选择</option>
            </select>
          </p>
          <p class="item item0"><span class="itemTt0">您的实名信息</span></p>
          <p class="item"><span class="itemTt1" >您的姓名<i class="iconfont icon-starfull"></i></span>
          <input type="text" name="contact_name" class="input1" required/></p>
          <p class="item">
            <span class="itemTt1">所在岗位<i class="iconfont icon-starfull"></i></span>
            <input name="job_title" type="text"  class="input1" required/></p>
          </p>
          <p class="item"><span class="itemTt1">固定电话<i class="iconfont icon-starfull"></i></span>
          <input type="text" name="contact_tel" class="input1" onkeyup="this.value=this.value.replace(/\D/g,'')" required/></p>
          <p class="item"><span class="itemTt1">联系邮箱</span>
          <input type="text"  class="input1"></p>
          <p class="item agree"><span class="check-box" required/></span>我已阅读并同意《添品网企业认证协议》</p>
          <p class="item btns"><input class="btn-small-default" type="submit" value="提交认证"></p>
        
        </form>


      </div>
    </div>
  </div>
</div>

    <?php }else{?>
          <div class="guarantee">
          <div class="item item1"><i class="iconfont icon-huiyuan"></i><p class="txt1">企业会员<br/>专享特权</p></div>
          <div class="item"><i class="iconfont icon-mianfei"></i><p class="tt1">样品费全免</p><p class="txt1">所有样品一律免费<br/>不受采购数量限制</p></div>
          <div class="item"><i class="iconfont icon-peisong"></i><p class="tt1">优先发货</p><p class="txt1">优先配货<br/>急速发货</p></div>
          <div class="item item4"><i class="iconfont icon-hetong"></i><p class="tt1">合同增票保障</p><p class="txt1">采购合同配备 增票集中开具<br/>保障企业权益</p></div>
        </div>

        <p class="txt2">服务须知：我们的审核时限为24小时(工作日)，遇法定节假日顺延。如有疑问，请拨打企业专享热线：400-888-8888</p>
        <form name="company" action="/members/cer" method='post' class="membersInfo">
          <p class="item item0"><span class="itemTt0">您的公司信息</span></p>
          <p class="item"><span class="itemTt1">公司名称<i class="iconfont icon-starfull"></i></span>
          <input type="text" name="company_name" class="input1" required/></p>
           <p class="item">
       <!--  <span class="itemTt">省份 <i class="iconfont icon-starfull"></i></span>
        -->
        <select name="province" id="province" class="input2">
            <option value="">请选择</option>
          <?php foreach ($province as $key => $value): ?>
            <option value="<?=$value['id']?>"><?=Html::encode($value['name'])?></option>
          <?php endforeach ?>
        </select>

        <select name="city" id="city"  class="input2">
          <option value="">请选择</option>
        </select>

        <select name="address_detail" id="town" class="input2">
          <option value="">请选择</option>
        </select>
       
      </p>
          <p class="item"><span class="itemTt1">公司详细地址<i class="iconfont icon-starfull"></i></span>
          <input type="text" name="address_detail" class="input3" required></p>
          <p class="item">
            <span class="itemTt1 itemTt2">采购类型/用途<i class="iconfont icon-starfull"></i></span>
            <input  class="check-box" type="checkbox" value="食品添加剂1"/>食品添加剂
            <input  class="check-box" type="checkbox" value="食品添加剂2"/>食品添加剂
            <input  class="check-box" type="checkbox" value="食品添加剂3"/>食品添加剂
            <input  class="check-box" type="checkbox" value="食品添加剂4"/>食品添加剂
            <input name="username" type="hidden">
            <input  name="create_time" type="hidden">


      </p>
          <p class="item">
            <span class="itemTt1">企业人数</span>
            <select name="" id="" class="input2">
              <option value="">请选择</option>
            </select>
          </p>
          <p class="item">
            <span class="itemTt1">公司行业</span>
            <select name="" id=""  class="input1">
              <option value="">请选择</option>
            </select>
          </p>
          <p class="item">
            <span class="itemTt1">公司性质</span>
            <select name="" id=""  class="input1">
              <option value="">请选择</option>
            </select>
          </p>
          <p class="item item0"><span class="itemTt0">您的实名信息</span></p>
          <p class="item"><span class="itemTt1" >您的姓名<i class="iconfont icon-starfull"></i></span>
          <input type="text" name="contact_name" class="input1" required/></p>
          <p class="item">
            <span class="itemTt1">所在岗位<i class="iconfont icon-starfull"></i></span>
            <input name="job_title" type="text"  class="input1" required/></p>
          </p>
          <p class="item"><span class="itemTt1">固定电话<i class="iconfont icon-starfull"></i></span>
          <input type="text" name="contact_tel" class="input1" onkeyup="this.value=this.value.replace(/\D/g,'')" required/></p>
          <p class="item"><span class="itemTt1">联系邮箱</span>
          <input type="text"  class="input1"></p>
          <p class="item agree"><span class="check-box" required/></span>我已阅读并同意《添品网企业认证协议》</p>
          <p class="item btns"><input class="btn-small-default" type="submit" value="提交认证"></p>
        
        </form>


      </div>
    </div>
  </div>


</div>

 <?php }?>


<script>
  $(function(){

   $('.navList li:eq(2) dd:eq(0) a').attr('class','current');//---右侧导航


   //AJAX获取省级id对应的市的信息
    $('#province').on('change',function(){
      var city = '';
      var town = '';
      $('#town').html('');

      if($(this).val() == ''){
        $('#town').html('<option>请选择</option>');
        $('#city').html('<option>请选择</option>');
      }
      $.post('',{'province_id':$(this).val()},function(data){
        var data = eval('('+data+')');
        var para = data[0]['list'];

        for(var k in data){
          city += '<option value="'+data[k]["id"]+'">'+data[k]["name"]+'</option>';
        }
        for (var j in para) {
          town += '<option value="'+para[j]['id']+'">'+para[j]["name"]+'</option>';
        }
        $('#city').html('');
        $('#town').append(town);
        $('#city').append(city);
      });
    });

    $('#city').on('change',function(){
      var town;
      $('#town').html('');
      $.post('',{'city_id':$(this).val()},function(data){
        var data = eval('('+data+')');

        for(var k in data){
          town += '<option value="'+data[k]["id"]+'">'+data[k]["name"]+'</option>';
        }
        $('#town').html('');
        $('#town').append(town);
      });
    });

});

</script>
